package com.kaibes.web.request;

import javax.servlet.http.HttpServletRequest;

import org.springframework.core.annotation.Order;

import com.kaibes.web.filter.FilterInternal;

public interface RequestBodyListener {
    
    boolean supports(HttpServletRequest request);
    byte[] doWithBody(FilterInternal filterInternal, byte[] body);

    default int order() {
        Order order = getClass().getDeclaredAnnotation(Order.class);
        if (order == null) {
            return 0;
        } else {
            return order.value();
        }
    };
    
}
